home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Bank smakow / BankSmakow.air / BankSmakow.swf / scripts / mx / managers / CursorManagerImpl.as < prev    next >
Text File  |  2009-12-16  |  27KB  |  769 lines

  1. package mx.managers
  2. {
  3.    import flash.display.DisplayObject;
  4.    import flash.display.DisplayObjectContainer;
  5.    import flash.display.InteractiveObject;
  6.    import flash.display.Sprite;
  7.    import flash.events.ContextMenuEvent;
  8.    import flash.events.Event;
  9.    import flash.events.EventDispatcher;
  10.    import flash.events.IEventDispatcher;
  11.    import flash.events.IOErrorEvent;
  12.    import flash.events.MouseEvent;
  13.    import flash.events.ProgressEvent;
  14.    import flash.geom.Point;
  15.    import flash.text.TextField;
  16.    import flash.text.TextFieldType;
  17.    import flash.ui.Mouse;
  18.    import mx.core.ApplicationGlobals;
  19.    import mx.core.EventPriority;
  20.    import mx.core.FlexSprite;
  21.    import mx.core.mx_internal;
  22.    import mx.events.InterManagerRequest;
  23.    import mx.events.SWFBridgeRequest;
  24.    import mx.events.SandboxMouseEvent;
  25.    import mx.styles.CSSStyleDeclaration;
  26.    import mx.styles.StyleManager;
  27.    
  28.    use namespace mx_internal;
  29.    
  30.    public class CursorManagerImpl implements ICursorManager
  31.    {
  32.       
  33.       mx_internal static const VERSION:String = "3.5.0.12683";
  34.       
  35.       private static var instance:ICursorManager;
  36.        
  37.       
  38.       private var showSystemCursor:Boolean = false;
  39.       
  40.       private var nextCursorID:int = 1;
  41.       
  42.       private var systemManager:ISystemManager = null;
  43.       
  44.       private var cursorList:Array;
  45.       
  46.       private var _currentCursorYOffset:Number = 0;
  47.       
  48.       private var cursorHolder:Sprite;
  49.       
  50.       private var currentCursor:DisplayObject;
  51.       
  52.       private var sandboxRoot:IEventDispatcher = null;
  53.       
  54.       private var showCustomCursor:Boolean = false;
  55.       
  56.       private var listenForContextMenu:Boolean = false;
  57.       
  58.       private var customCursorLeftStage:Boolean = false;
  59.       
  60.       private var _currentCursorID:int = 0;
  61.       
  62.       private var initialized:Boolean = false;
  63.       
  64.       private var overTextField:Boolean = false;
  65.       
  66.       private var _currentCursorXOffset:Number = 0;
  67.       
  68.       private var busyCursorList:Array;
  69.       
  70.       private var overLink:Boolean = false;
  71.       
  72.       private var sourceArray:Array;
  73.       
  74.       public function CursorManagerImpl(param1:ISystemManager = null)
  75.       {
  76.          cursorList = [];
  77.          busyCursorList = [];
  78.          sourceArray = [];
  79.          super();
  80.          if(instance && !param1)
  81.          {
  82.             throw new Error("Instance already exists.");
  83.          }
  84.          if(param1)
  85.          {
  86.             this.systemManager = param1 as ISystemManager;
  87.          }
  88.          else
  89.          {
  90.             this.systemManager = SystemManagerGlobals.topLevelSystemManagers[0] as ISystemManager;
  91.          }
  92.          sandboxRoot = this.systemManager.getSandboxRoot();
  93.          sandboxRoot.addEventListener(InterManagerRequest.CURSOR_MANAGER_REQUEST,marshalCursorManagerHandler,false,0,true);
  94.          var _loc2_:InterManagerRequest = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
  95.          _loc2_.name = "update";
  96.          sandboxRoot.dispatchEvent(_loc2_);
  97.       }
  98.       
  99.       public static function getInstance() : ICursorManager
  100.       {
  101.          if(!instance)
  102.          {
  103.             instance = new CursorManagerImpl();
  104.          }
  105.          return instance;
  106.       }
  107.       
  108.       private function mouseOverHandler(param1:MouseEvent) : void
  109.       {
  110.          sandboxRoot.removeEventListener(MouseEvent.MOUSE_OVER,mouseOverHandler);
  111.          mouseMoveHandler(param1);
  112.       }
  113.       
  114.       public function set currentCursorYOffset(param1:Number) : void
  115.       {
  116.          var _loc2_:InterManagerRequest = null;
  117.          _currentCursorYOffset = param1;
  118.          if(!cursorHolder)
  119.          {
  120.             _loc2_ = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
  121.             _loc2_.name = "currentCursorYOffset";
  122.             _loc2_.value = currentCursorYOffset;
  123.             sandboxRoot.dispatchEvent(_loc2_);
  124.          }
  125.       }
  126.       
  127.       public function get currentCursorXOffset() : Number
  128.       {
  129.          return _currentCursorXOffset;
  130.       }
  131.       
  132.       public function removeCursor(param1:int) : void
  133.       {
  134.          var _loc2_:* = null;
  135.          var _loc3_:InterManagerRequest = null;
  136.          var _loc4_:CursorQueueItem = null;
  137.          if(initialized && !cursorHolder)
  138.          {
  139.             _loc3_ = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
  140.             _loc3_.name = "removeCursor";
  141.             _loc3_.value = param1;
  142.             sandboxRoot.dispatchEvent(_loc3_);
  143.             return;
  144.          }
  145.          for(_loc2_ in cursorList)
  146.          {
  147.             if((_loc4_ = cursorList[_loc2_]).cursorID == param1)
  148.             {
  149.                cursorList.splice(_loc2_,1);
  150.                showCurrentCursor();
  151.                break;
  152.             }
  153.          }
  154.       }
  155.       
  156.       public function get currentCursorID() : int
  157.       {
  158.          return _currentCursorID;
  159.       }
  160.       
  161.       private function removeContextMenuHandlers() : void
  162.       {
  163.          var _loc1_:InteractiveObject = null;
  164.          var _loc2_:InteractiveObject = null;
  165.          if(listenForContextMenu)
  166.          {
  167.             _loc1_ = systemManager.document as InteractiveObject;
  168.             _loc2_ = systemManager as InteractiveObject;
  169.             if(_loc1_ && _loc1_.contextMenu)
  170.             {
  171.                _loc1_.contextMenu.removeEventListener(ContextMenuEvent.MENU_SELECT,contextMenu_menuSelectHandler,true);
  172.             }
  173.             if(_loc2_ && _loc2_.contextMenu)
  174.             {
  175.                _loc2_.contextMenu.removeEventListener(ContextMenuEvent.MENU_SELECT,contextMenu_menuSelectHandler,true);
  176.             }
  177.             listenForContextMenu = false;
  178.          }
  179.       }
  180.       
  181.       private function marshalMouseMoveHandler(param1:Event) : void
  182.       {
  183.          var _loc2_:SWFBridgeRequest = null;
  184.          var _loc3_:IEventDispatcher = null;
  185.          if(cursorHolder.visible)
  186.          {
  187.             cursorHolder.visible = false;
  188.             _loc2_ = new SWFBridgeRequest(SWFBridgeRequest.SHOW_MOUSE_CURSOR_REQUEST);
  189.             if(systemManager.useSWFBridge())
  190.             {
  191.                _loc3_ = systemManager.swfBridgeGroup.parentBridge;
  192.             }
  193.             else
  194.             {
  195.                _loc3_ = systemManager;
  196.             }
  197.             _loc2_.requestor = _loc3_;
  198.             _loc3_.dispatchEvent(_loc2_);
  199.             if(_loc2_.data)
  200.             {
  201.                Mouse.show();
  202.             }
  203.          }
  204.       }
  205.       
  206.       public function set currentCursorID(param1:int) : void
  207.       {
  208.          var _loc2_:InterManagerRequest = null;
  209.          _currentCursorID = param1;
  210.          if(!cursorHolder)
  211.          {
  212.             _loc2_ = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
  213.             _loc2_.name = "currentCursorID";
  214.             _loc2_.value = currentCursorID;
  215.             sandboxRoot.dispatchEvent(_loc2_);
  216.          }
  217.       }
  218.       
  219.       private function priorityCompare(param1:CursorQueueItem, param2:CursorQueueItem) : int
  220.       {
  221.          if(param1.priority < param2.priority)
  222.          {
  223.             return -1;
  224.          }
  225.          if(param1.priority == param2.priority)
  226.          {
  227.             return 0;
  228.          }
  229.          return 1;
  230.       }
  231.       
  232.       private function mouseOutHandler(param1:MouseEvent) : void
  233.       {
  234.          if(param1.relatedObject == null && cursorList.length > 0)
  235.          {
  236.             customCursorLeftStage = true;
  237.             hideCursor();
  238.             Mouse.show();
  239.          }
  240.       }
  241.       
  242.       public function setBusyCursor() : void
  243.       {
  244.          var _loc3_:InterManagerRequest = null;
  245.          if(initialized && !cursorHolder)
  246.          {
  247.             _loc3_ = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
  248.             _loc3_.name = "setBusyCursor";
  249.             sandboxRoot.dispatchEvent(_loc3_);
  250.             return;
  251.          }
  252.          var _loc1_:CSSStyleDeclaration = StyleManager.getStyleDeclaration("CursorManager");
  253.          var _loc2_:Class = _loc1_.getStyle("busyCursor");
  254.          busyCursorList.push(setCursor(_loc2_,CursorManagerPriority.LOW));
  255.       }
  256.       
  257.       private function findSource(param1:Object) : int
  258.       {
  259.          var _loc2_:int = sourceArray.length;
  260.          var _loc3_:int = 0;
  261.          while(_loc3_ < _loc2_)
  262.          {
  263.             if(sourceArray[_loc3_] === param1)
  264.             {
  265.                return _loc3_;
  266.             }
  267.             _loc3_++;
  268.          }
  269.          return -1;
  270.       }
  271.       
  272.       private function showCurrentCursor() : void
  273.       {
  274.          var _loc1_:CursorQueueItem = null;
  275.          var _loc2_:InterManagerRequest = null;
  276.          var _loc3_:Point = null;
  277.          if(cursorList.length > 0)
  278.          {
  279.             if(!initialized)
  280.             {
  281.                cursorHolder = new FlexSprite();
  282.                cursorHolder.name = "cursorHolder";
  283.                cursorHolder.mouseEnabled = false;
  284.                cursorHolder.mouseChildren = false;
  285.                systemManager.addChildToSandboxRoot("cursorChildren",cursorHolder);
  286.                initialized = true;
  287.                _loc2_ = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
  288.                _loc2_.name = "initialized";
  289.                sandboxRoot.dispatchEvent(_loc2_);
  290.             }
  291.             _loc1_ = cursorList[0];
  292.             if(currentCursorID == CursorManager.NO_CURSOR)
  293.             {
  294.                Mouse.hide();
  295.             }
  296.             if(_loc1_.cursorID != currentCursorID)
  297.             {
  298.                if(cursorHolder.numChildren > 0)
  299.                {
  300.                   cursorHolder.removeChildAt(0);
  301.                }
  302.                currentCursor = new _loc1_.cursorClass();
  303.                if(currentCursor)
  304.                {
  305.                   if(currentCursor is InteractiveObject)
  306.                   {
  307.                      InteractiveObject(currentCursor).mouseEnabled = false;
  308.                   }
  309.                   if(currentCursor is DisplayObjectContainer)
  310.                   {
  311.                      DisplayObjectContainer(currentCursor).mouseChildren = false;
  312.                   }
  313.                   cursorHolder.addChild(currentCursor);
  314.                   addContextMenuHandlers();
  315.                   if(systemManager is SystemManager)
  316.                   {
  317.                      _loc3_ = new Point(SystemManager(systemManager).mouseX + _loc1_.x,SystemManager(systemManager).mouseY + _loc1_.y);
  318.                      _loc3_ = SystemManager(systemManager).localToGlobal(_loc3_);
  319.                      _loc3_ = cursorHolder.parent.globalToLocal(_loc3_);
  320.                      cursorHolder.x = _loc3_.x;
  321.                      cursorHolder.y = _loc3_.y;
  322.                   }
  323.                   else if(systemManager is DisplayObject)
  324.                   {
  325.                      _loc3_ = new Point(DisplayObject(systemManager).mouseX + _loc1_.x,DisplayObject(systemManager).mouseY + _loc1_.y);
  326.                      _loc3_ = DisplayObject(systemManager).localToGlobal(_loc3_);
  327.                      _loc3_ = cursorHolder.parent.globalToLocal(_loc3_);
  328.                      cursorHolder.x = DisplayObject(systemManager).mouseX + _loc1_.x;
  329.                      cursorHolder.y = DisplayObject(systemManager).mouseY + _loc1_.y;
  330.                   }
  331.                   else
  332.                   {
  333.                      cursorHolder.x = _loc1_.x;
  334.                      cursorHolder.y = _loc1_.y;
  335.                   }
  336.                   if(systemManager.useSWFBridge())
  337.                   {
  338.                      sandboxRoot.addEventListener(MouseEvent.MOUSE_MOVE,mouseMoveHandler,true,EventPriority.CURSOR_MANAGEMENT);
  339.                   }
  340.                   else
  341.                   {
  342.                      systemManager.stage.addEventListener(MouseEvent.MOUSE_MOVE,mouseMoveHandler,true,EventPriority.CURSOR_MANAGEMENT);
  343.                   }
  344.                   sandboxRoot.addEventListener(SandboxMouseEvent.MOUSE_MOVE_SOMEWHERE,marshalMouseMoveHandler,false,EventPriority.CURSOR_MANAGEMENT);
  345.                   if(systemManager.useSWFBridge())
  346.                   {
  347.                      sandboxRoot.addEventListener(MouseEvent.MOUSE_OUT,mouseOutHandler,true,EventPriority.CURSOR_MANAGEMENT);
  348.                   }
  349.                   else
  350.                   {
  351.                      systemManager.stage.addEventListener(MouseEvent.MOUSE_OUT,mouseOutHandler,true,EventPriority.CURSOR_MANAGEMENT);
  352.                   }
  353.                }
  354.                currentCursorID = _loc1_.cursorID;
  355.                currentCursorXOffset = _loc1_.x;
  356.                currentCursorYOffset = _loc1_.y;
  357.             }
  358.          }
  359.          else
  360.          {
  361.             showCustomCursor = false;
  362.             if(currentCursorID != CursorManager.NO_CURSOR)
  363.             {
  364.                currentCursorID = CursorManager.NO_CURSOR;
  365.                currentCursorXOffset = 0;
  366.                currentCursorYOffset = 0;
  367.                cursorHolder.removeChild(currentCursor);
  368.                removeSystemManagerHandlers();
  369.                removeContextMenuHandlers();
  370.             }
  371.             Mouse.show();
  372.          }
  373.       }
  374.       
  375.       public function get currentCursorYOffset() : Number
  376.       {
  377.          return _currentCursorYOffset;
  378.       }
  379.       
  380.       private function contextMenu_menuSelectHandler(param1:ContextMenuEvent) : void
  381.       {
  382.          showCustomCursor = true;
  383.          sandboxRoot.addEventListener(MouseEvent.MOUSE_OVER,mouseOverHandler);
  384.       }
  385.       
  386.       public function hideCursor() : void
  387.       {
  388.          var _loc1_:InterManagerRequest = null;
  389.          if(cursorHolder)
  390.          {
  391.             cursorHolder.visible = false;
  392.          }
  393.          else
  394.          {
  395.             _loc1_ = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
  396.             _loc1_.name = "hideCursor";
  397.             sandboxRoot.dispatchEvent(_loc1_);
  398.          }
  399.       }
  400.       
  401.       public function showCursor() : void
  402.       {
  403.          var _loc1_:InterManagerRequest = null;
  404.          if(cursorHolder)
  405.          {
  406.             cursorHolder.visible = true;
  407.          }
  408.          else
  409.          {
  410.             _loc1_ = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
  411.             _loc1_.name = "showCursor";
  412.             sandboxRoot.dispatchEvent(_loc1_);
  413.          }
  414.       }
  415.       
  416.       private function marshalCursorManagerHandler(param1:Event) : void
  417.       {
  418.          var _loc3_:InterManagerRequest = null;
  419.          if(param1 is InterManagerRequest)
  420.          {
  421.             return;
  422.          }
  423.          var _loc2_:Object = param1;
  424.          switch(_loc2_.name)
  425.          {
  426.             case "initialized":
  427.                initialized = _loc2_.value;
  428.                break;
  429.             case "currentCursorID":
  430.                _currentCursorID = _loc2_.value;
  431.                break;
  432.             case "currentCursorXOffset":
  433.                _currentCursorXOffset = _loc2_.value;
  434.                break;
  435.             case "currentCursorYOffset":
  436.                _currentCursorYOffset = _loc2_.value;
  437.                break;
  438.             case "showCursor":
  439.                if(cursorHolder)
  440.                {
  441.                   cursorHolder.visible = true;
  442.                }
  443.                break;
  444.             case "hideCursor":
  445.                if(cursorHolder)
  446.                {
  447.                   cursorHolder.visible = false;
  448.                }
  449.                break;
  450.             case "setCursor":
  451.                if(cursorHolder)
  452.                {
  453.                   _loc2_.value = setCursor.apply(this,_loc2_.value);
  454.                }
  455.                break;
  456.             case "removeCursor":
  457.                if(cursorHolder)
  458.                {
  459.                   removeCursor.apply(this,[_loc2_.value]);
  460.                }
  461.                break;
  462.             case "removeAllCursors":
  463.                if(cursorHolder)
  464.                {
  465.                   removeAllCursors();
  466.                }
  467.                break;
  468.             case "setBusyCursor":
  469.                if(cursorHolder)
  470.                {
  471.                   setBusyCursor();
  472.                }
  473.                break;
  474.             case "removeBusyCursor":
  475.                if(cursorHolder)
  476.                {
  477.                   removeBusyCursor();
  478.                }
  479.                break;
  480.             case "registerToUseBusyCursor":
  481.                if(cursorHolder)
  482.                {
  483.                   registerToUseBusyCursor.apply(this,_loc2_.value);
  484.                }
  485.                break;
  486.             case "unRegisterToUseBusyCursor":
  487.                if(cursorHolder)
  488.                {
  489.                   unRegisterToUseBusyCursor.apply(this,_loc2_.value);
  490.                }
  491.                break;
  492.             case "update":
  493.                if(cursorHolder)
  494.                {
  495.                   _loc3_ = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
  496.                   _loc3_.name = "initialized";
  497.                   _loc3_.value = true;
  498.                   sandboxRoot.dispatchEvent(_loc3_);
  499.                   _loc3_ = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
  500.                   _loc3_.name = "currentCursorID";
  501.                   _loc3_.value = currentCursorID;
  502.                   sandboxRoot.dispatchEvent(_loc3_);
  503.                   _loc3_ = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
  504.                   _loc3_.name = "currentCursorXOffset";
  505.                   _loc3_.value = currentCursorXOffset;
  506.                   sandboxRoot.dispatchEvent(_loc3_);
  507.                   _loc3_ = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
  508.                   _loc3_.name = "currentCursorYOffset";
  509.                   _loc3_.value = currentCursorYOffset;
  510.                   sandboxRoot.dispatchEvent(_loc3_);
  511.                }
  512.          }
  513.       }
  514.       
  515.       public function removeAllCursors() : void
  516.       {
  517.          var _loc1_:InterManagerRequest = null;
  518.          if(initialized && !cursorHolder)
  519.          {
  520.             _loc1_ = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
  521.             _loc1_.name = "removeAllCursors";
  522.             sandboxRoot.dispatchEvent(_loc1_);
  523.             return;
  524.          }
  525.          cursorList.splice(0);
  526.          showCurrentCursor();
  527.       }
  528.       
  529.       private function completeHandler(param1:Event) : void
  530.       {
  531.          var _loc2_:int = findSource(param1.target);
  532.          if(_loc2_ != -1)
  533.          {
  534.             sourceArray.splice(_loc2_,1);
  535.             removeBusyCursor();
  536.          }
  537.       }
  538.       
  539.       public function removeBusyCursor() : void
  540.       {
  541.          var _loc1_:InterManagerRequest = null;
  542.          if(initialized && !cursorHolder)
  543.          {
  544.             _loc1_ = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
  545.             _loc1_.name = "removeBusyCursor";
  546.             sandboxRoot.dispatchEvent(_loc1_);
  547.             return;
  548.          }
  549.          if(busyCursorList.length > 0)
  550.          {
  551.             removeCursor(int(busyCursorList.pop()));
  552.          }
  553.       }
  554.       
  555.       private function addContextMenuHandlers() : void
  556.       {
  557.          var _loc1_:InteractiveObject = null;
  558.          var _loc2_:InteractiveObject = null;
  559.          if(!listenForContextMenu)
  560.          {
  561.             _loc1_ = systemManager.document as InteractiveObject;
  562.             _loc2_ = systemManager as InteractiveObject;
  563.             if(_loc1_ && _loc1_.contextMenu)
  564.             {
  565.                _loc1_.contextMenu.addEventListener(ContextMenuEvent.MENU_SELECT,contextMenu_menuSelectHandler,true,EventPriority.CURSOR_MANAGEMENT);
  566.                listenForContextMenu = true;
  567.             }
  568.             if(_loc2_ && _loc2_.contextMenu)
  569.             {
  570.                _loc2_.contextMenu.addEventListener(ContextMenuEvent.MENU_SELECT,contextMenu_menuSelectHandler,true,EventPriority.CURSOR_MANAGEMENT);
  571.                listenForContextMenu = true;
  572.             }
  573.          }
  574.       }
  575.       
  576.       public function setCursor(param1:Class, param2:int = 2, param3:Number = 0, param4:Number = 0) : int
  577.       {
  578.          var _loc7_:InterManagerRequest = null;
  579.          if(initialized && !cursorHolder)
  580.          {
  581.             (_loc7_ = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST)).name = "setCursor";
  582.             _loc7_.value = [param1,param2,param3,param4];
  583.             sandboxRoot.dispatchEvent(_loc7_);
  584.             return _loc7_.value as int;
  585.          }
  586.          var _loc5_:int = nextCursorID++;
  587.          var _loc6_:CursorQueueItem;
  588.          (_loc6_ = new CursorQueueItem()).cursorID = _loc5_;
  589.          _loc6_.cursorClass = param1;
  590.          _loc6_.priority = param2;
  591.          _loc6_.x = param3;
  592.          _loc6_.y = param4;
  593.          if(systemManager)
  594.          {
  595.             _loc6_.systemManager = systemManager;
  596.          }
  597.          else
  598.          {
  599.             _loc6_.systemManager = ApplicationGlobals.application.systemManager;
  600.          }
  601.          cursorList.push(_loc6_);
  602.          cursorList.sort(priorityCompare);
  603.          showCurrentCursor();
  604.          return _loc5_;
  605.       }
  606.       
  607.       private function progressHandler(param1:ProgressEvent) : void
  608.       {
  609.          var _loc2_:int = findSource(param1.target);
  610.          if(_loc2_ == -1)
  611.          {
  612.             sourceArray.push(param1.target);
  613.             setBusyCursor();
  614.          }
  615.       }
  616.       
  617.       private function removeSystemManagerHandlers() : void
  618.       {
  619.          if(systemManager.useSWFBridge())
  620.          {
  621.             sandboxRoot.removeEventListener(MouseEvent.MOUSE_MOVE,mouseMoveHandler,true);
  622.          }
  623.          else
  624.          {
  625.             systemManager.stage.removeEventListener(MouseEvent.MOUSE_MOVE,mouseMoveHandler,true);
  626.          }
  627.          sandboxRoot.removeEventListener(SandboxMouseEvent.MOUSE_MOVE_SOMEWHERE,marshalMouseMoveHandler,false);
  628.          if(systemManager.useSWFBridge())
  629.          {
  630.             sandboxRoot.removeEventListener(MouseEvent.MOUSE_OUT,mouseMoveHandler,true);
  631.          }
  632.          else
  633.          {
  634.             systemManager.stage.removeEventListener(MouseEvent.MOUSE_OUT,mouseOutHandler,true);
  635.          }
  636.       }
  637.       
  638.       public function registerToUseBusyCursor(param1:Object) : void
  639.       {
  640.          var _loc2_:InterManagerRequest = null;
  641.          if(initialized && !cursorHolder)
  642.          {
  643.             _loc2_ = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
  644.             _loc2_.name = "registerToUseBusyCursor";
  645.             _loc2_.value = param1;
  646.             sandboxRoot.dispatchEvent(_loc2_);
  647.             return;
  648.          }
  649.          if(param1 && param1 is EventDispatcher)
  650.          {
  651.             param1.addEventListener(ProgressEvent.PROGRESS,progressHandler);
  652.             param1.addEventListener(Event.COMPLETE,completeHandler);
  653.             param1.addEventListener(IOErrorEvent.IO_ERROR,completeHandler);
  654.          }
  655.       }
  656.       
  657.       private function mouseMoveHandler(param1:MouseEvent) : void
  658.       {
  659.          var _loc4_:SWFBridgeRequest = null;
  660.          var _loc5_:IEventDispatcher = null;
  661.          var _loc2_:Point = new Point(param1.stageX,param1.stageY);
  662.          _loc2_ = cursorHolder.parent.globalToLocal(_loc2_);
  663.          _loc2_.x += currentCursorXOffset;
  664.          _loc2_.y += currentCursorYOffset;
  665.          cursorHolder.x = _loc2_.x;
  666.          cursorHolder.y = _loc2_.y;
  667.          var _loc3_:Object = param1.target;
  668.          if(!overTextField && _loc3_ is TextField && _loc3_.type == TextFieldType.INPUT)
  669.          {
  670.             overTextField = true;
  671.             showSystemCursor = true;
  672.          }
  673.          else if(overTextField && !(_loc3_ is TextField && _loc3_.type == TextFieldType.INPUT))
  674.          {
  675.             overTextField = false;
  676.             showCustomCursor = true;
  677.          }
  678.          else
  679.          {
  680.             showCustomCursor = true;
  681.          }
  682.          if(showSystemCursor)
  683.          {
  684.             showSystemCursor = false;
  685.             cursorHolder.visible = false;
  686.             Mouse.show();
  687.          }
  688.          if(showCustomCursor)
  689.          {
  690.             showCustomCursor = false;
  691.             cursorHolder.visible = true;
  692.             Mouse.hide();
  693.             _loc4_ = new SWFBridgeRequest(SWFBridgeRequest.HIDE_MOUSE_CURSOR_REQUEST);
  694.             if(systemManager.useSWFBridge())
  695.             {
  696.                _loc5_ = systemManager.swfBridgeGroup.parentBridge;
  697.             }
  698.             else
  699.             {
  700.                _loc5_ = systemManager;
  701.             }
  702.             _loc4_.requestor = _loc5_;
  703.             _loc5_.dispatchEvent(_loc4_);
  704.          }
  705.       }
  706.       
  707.       public function unRegisterToUseBusyCursor(param1:Object) : void
  708.       {
  709.          var _loc2_:InterManagerRequest = null;
  710.          if(initialized && !cursorHolder)
  711.          {
  712.             _loc2_ = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
  713.             _loc2_.name = "unRegisterToUseBusyCursor";
  714.             _loc2_.value = param1;
  715.             sandboxRoot.dispatchEvent(_loc2_);
  716.             return;
  717.          }
  718.          if(param1 && param1 is EventDispatcher)
  719.          {
  720.             param1.removeEventListener(ProgressEvent.PROGRESS,progressHandler);
  721.             param1.removeEventListener(Event.COMPLETE,completeHandler);
  722.             param1.removeEventListener(IOErrorEvent.IO_ERROR,completeHandler);
  723.          }
  724.       }
  725.       
  726.       public function set currentCursorXOffset(param1:Number) : void
  727.       {
  728.          var _loc2_:InterManagerRequest = null;
  729.          _currentCursorXOffset = param1;
  730.          if(!cursorHolder)
  731.          {
  732.             _loc2_ = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
  733.             _loc2_.name = "currentCursorXOffset";
  734.             _loc2_.value = currentCursorXOffset;
  735.             sandboxRoot.dispatchEvent(_loc2_);
  736.          }
  737.       }
  738.    }
  739. }
  740.  
  741. import mx.core.mx_internal;
  742. import mx.managers.ISystemManager;
  743.  
  744. use namespace mx_internal;
  745.  
  746. class CursorQueueItem
  747. {
  748.    
  749.    mx_internal static const VERSION:String = "3.5.0.12683";
  750.     
  751.    
  752.    public var priority:int = 2;
  753.    
  754.    public var cursorClass:Class = null;
  755.    
  756.    public var cursorID:int = 0;
  757.    
  758.    public var x:Number;
  759.    
  760.    public var y:Number;
  761.    
  762.    public var systemManager:ISystemManager;
  763.    
  764.    function CursorQueueItem()
  765.    {
  766.       super();
  767.    }
  768. }
  769.